<?php 
namespace app\common\model\trade;

use think\Model;
use app\common\model\user\Users;

class TradeMate extends Model
{
	public function getSalesIdAttr($v)
	{
		return Users::where(['id' =>$v])->field('id,user_name')->find();
	}
	public function getBuyIdAttr($v)
	{
		return Users::where(['id' =>$v])->field('id,user_name')->find();
	}
	public function getCreateTimeAttr($v)
	{
		return date('Y-m-d H:i:s',$v);
	}
	public function getPayTimeAttr($v)
	{
		return $v ? date('Y-m-d H:i:s',$v) : '--';
	}
	public function getTrueTimeAttr($v)
	{
		return $v ? date('Y-m-d H:i:s',$v) : '--';
	}
	public function getCancelTimeAttr($v)
	{
		return $v ? date('Y-m-d H:i:s',$v) : '--';
	}
	public function getPaymentVoucherAttr($v)
    {
        return $v ? 'http://'.$_SERVER['HTTP_HOST'].$v : '暂无打款凭证';
    }
}